<!--%import("../../tpl/js/product.js")-->
<!--%import("../../tpl/js/thumbnail_view.js")-->
<!--%import("../../tpl/js/view_document.js")-->
<!--%import("filter/insert_order.xml")-->

<!--%load_js_plugin("ui.stepper")-->

<div class="lineClear"></div>

<!-- 글 내용 보여주기 -->

<div class="productImageBox">
	<div class="imageItem">
    	<!--@if($oProduct->itemThumbnailExists(0, $module_info->view_image_width, $module_info->view_image_height, 'crop'))-->
			<img src="{$oProduct->getItemThumbnail(0, $module_info->view_image_width, $module_info->view_image_height, 'crop')}" id="master_image" />
        <!--@else-->
        	<img src="./img/common/img_blank.gif" width="{$module_info->view_image_width}" height="{$module_info->view_image_height}" />
        <!--@end-->
    </div>
    
    <div class="lineClear"></div>
    
    <div class="imageList">
		<!-- 작은섬네일 -->
		{@$thumbnails = $oProduct->getItemThumbnailList($module_info->view_thumbnail_width, $module_info->view_thumbnail_height, 'crop')}
        {@$thumb_total_count = count($thumbnails)}
        
        <!--@if( $thumb_total_count > 4)-->
        	<img src="img/common/btn_prev.gif" onclick="doPrevThumb(); return false;" class="bt" />
        <!--@end-->
        
        {@$n=0}
        <!--@foreach($thumbnails as $thumbnail)-->
        	
            <img src="{$thumbnail}" image_middle="{$oProduct->getItemThumbnail($n, $module_info->view_image_width, $module_info->view_image_height, 'crop')}" tabindex="{$n}" class="prod_thumb" <!--@if( $n >= 4)-->style="display:none;"<!--@end--> />

        {@$n=$n+1}
        <!--@end-->
        
        <!--@if( $thumb_total_count > 4)-->
        	<img src="img/common/btn_next.gif" onclick="doNextThumb(); return false;" class="bt" />
        <!--@end-->

		<!-- 작은섬네일 -->
    </div>
</div>

<div class="boardReadBody" style="display:none;">
	{$oDocument->getContent()}
	<div class="xe_content" id="xe_gallery_list">
		<!--@foreach($oProduct->thumbnails as $key => $value)-->
		<img src="{$value->uploaded_filename}" rel="xe_gallery" />
		<!--@end-->
	</div>
</div>

<form action="." method="post" id="orderForm">
<input type="hidden" name="remid" value="{$module_info->mid}" />
<input type="hidden" name="product_srl" value="{$oProduct->get('product_srl')}" />
<input type="hidden" name="document_srl" value="{$oProduct->get('document_srl')}" />
<div class="productPriceBox">
	<div class="title">{$oDocument->getTitle()}</div>
	<div class="code">Code : {$oProduct->get('code')}</div>
    
    <div class="lineClear"></div>

    <table>
    <tr>
        <th>{$lang->product_sale_price}</th>
        <td>
            <div class="price">{number_format($oProduct->get('price_sale'))} {$lang->monetary_unit}</div>
        </td>
    </tr>
    <tr>
        <th>{$lang->payment_info}</th>
        <td>
            {$module_info->payment_info_text}
        </td>
    </tr>
    <tr>
        <th>{$lang->product_give_point}</th>
        <td>
            {number_format($oProduct->get('buyed_point'))} p
        </td>
    </tr>
    <!--@if($module_info->is_shopxe)-->
    <tr>
        <th>{$lang->product_purchase_volume}</th>
        <td>
            <span class="ui-stepper">
                <input type="text" name="volume" value="1" class="inputTypeText w40 tRight"/>
            </span>
        </td>
    </tr>
   	<!--@if( $oProduct->options )-->
    <tr>
        <th>옵션</th>
        <td>
            <!--@foreach($oProduct->options as $key => $val)-->
            	<!--@if($val->option_parent_srl==0)-->
                <div class="option">
                <input type="hidden" name="option_req" value="{$val->option_req}" />
	        	<select name="options_list">
                	<option value="">{$val->option_name} :: 선택해주세요.</option>
                    <!--@foreach($oProduct->options as $key1 => $val1)-->
	                    <!--@if($val->option_srl==$val1->option_parent_srl)-->
                        <option value="{$val1->option_srl}">{$val1->option_name}<!--@if($val1->option_price)--> (+{$val1->option_price}원)<!--@end--></option>
                        <!--@end-->
                    <!--@end-->
	            </select>
                </div>
                <!--@end-->
            <!--@end-->
        </td>
    </tr>
    <!--@end-->
    <!--@end-->
    <tr>
        <th>{$lang->product_maker}/{$lang->product_origin} </th>
        <td>
            {$oProduct->get('maker')}
        </td>
    </tr>
    </table>

    <!--@if($oDocument->isExtraVarsExists() && (!$oDocument->isSecret() || $oDocument->isGranted()) )-->
    <table cellspacing="0" summary="" class="extraVarsList">
    <!--@foreach($oDocument->getExtraVars() as $key => $val)-->
    <tr>
        <th>{$val->name}</th>
        <td>{$val->getValueHTML()}</td>
    </tr>
    <!--@end-->
    </table>
    <!--@end-->
    

	<div class="orderButtom">
		<div class="lineClear"></div>    
	<!--@if($module_info->is_shopxe)-->    
		<span class="bigBtn"><a herf="#" onClick="doInsertOrderForm({$oProduct->get('document_srl')},'{$module_info->mid}'); false;">바로구매</a></span>
		<span class="bigBtn"><a herf="#" onClick="doInsertCart({$oProduct->get('document_srl')},'{$module_info->mid}'); false;">장바구니 담기</a></span>
		<span class="bigBtn"><a herf="#" onClick="doInsertWish({$oProduct->get('product_srl')},'{$module_info->mid}'); false;">관심물품 등록</a></span>
    <!--@end-->
        
    </div>
</div>
</form>

<div class="lineClear"></div>

<div class="InfoBox">
	<div class="head">
    	<div class="subject">{$lang->product_info}</div>
    </div>
    <div class="cont">
        {$oDocument->getContent(false,false,false,false)}
    </div>
</div>

<div class="lineClear"></div>

<div class="InfoBox">
	<div class="head">
    	<div class="subject">{$lang->delivery_info}</div>
    </div>
    <div class="cont">{$module_info->view_product_delivery}</div>
</div>

<div class="lineClear"></div>

<div class="InfoBox">
	<div class="head">
    	<div class="subject">{$lang->product_exchange}</div>
    </div>
    <div class="cont">
        {$module_info->view_product_exchange}
    </div>
</div>

<div class="lineClear"></div>

<!--@if($grant->manager)-->
<!-- 목록, 수정/삭제 버튼 -->
<div class="contentButton tRight">
    <a href="{getUrl('act','dispProductWrite','document_srl','')}" class="button green"><span>{$lang->cmd_write_product}</span></a>
    <a href="{getUrl('act','dispProductWrite','document_srl',$oDocument->document_srl,'comment_srl','')}" class="button blue"><span>{$lang->cmd_modify}</span></a>
    <a href="{getUrl('act','dispProductDelete','document_srl',$oDocument->document_srl,'comment_srl','')}" class="button red"><span>{$lang->cmd_delete}</span></a>
</div>
<!--@end-->

<div class="lineClear"></div>
<!--@if($oDocument->isEditable())-->
<div class="productRead tRight" style="border-top:1px solid #EFEFEF; padding-top:10px;">

</div>
<!--@end-->
<div class="lineClear"></div>

<!-- 댓글 -->
<a name="comment"></a>
<!--#include("./comment.html")-->

<!-- 댓글 입력 폼 -->
<!--@if($grant->write_comment && $oDocument->isEnableComment() )-->
<div class="replyBox">
    <!--%import("filter/insert_comment.xml")-->
    <form action="./" method="post" onsubmit="return procFilter(this, insert_comment)" class="boardEditor" >
    <input type="hidden" name="mid" value="{$mid}" />
    <input type="hidden" name="document_srl" value="{$oDocument->document_srl}" />
    <input type="hidden" name="comment_srl" value="" />
    <input type="hidden" name="content" value="" />
        <div class="boardWrite commentEditor">
            <div class="userNameAndPw">
                <!--@if(!$is_logged)-->
                <label for="userName">{$lang->writer}</label>
                <input type="text" name="nick_name" value="" class="userName inputTypeText" id="userName"/>

                <label for="userPw">{$lang->password}</label>
                <input type="password" name="password" value="" id="userPw" class="userPw inputTypeText" />

                <label for="emailAddress">{$lang->email_address}</label>
                <input type="text" name="email_address" value="" id="emailAddress" class="emailAddress inputTypeText"/>

                <label for="homePage">{$lang->homepage}</label>
                <input type="text" name="homepage" value="" id="homePage" class="homePage inputTypeText"/>
                <!--@else-->
                <input type="checkbox" name="notify_message" value="Y" id="notify_message" />
                <label for="notify_message">{$lang->notify}</label>
                <!--@end-->

                <input type="checkbox" name="is_secret" value="Y" id="is_secret" />
                <label for="is_secret">{$lang->secret}</label>

            </div>

            <div class="editor">{$oDocument->getCommentEditor()}</div>
        </div>

        <div class="commentButton tRight">
            <span class="button"><input type="submit" value="{$lang->cmd_comment_registration}" accesskey="s" /></span>
        </div>
    </form>
</div>
<!--@end-->

<div class="lineClear"></div>

<!-- 목록, 수정/삭제 버튼 -->
<div class="contentButton">
    <a href="{getUrl('','mid',$mid,'page',$page,'document_srl','','listStyle',$listStyle)}" class="button {$btn_class}"><span>{$lang->cmd_list}</span></a>
</div>